// 只作用在生产环境的插件
const prodPlugins = [];
if (process.env.NODE_ENV === "production") {
  // 去除console.log，保留报错和警告
  prodPlugins.push(["transform-remove-console", { "exclude": ["error", "warn"] }])
}

module.exports = {
  presets: ["@vue/cli-plugin-babel/preset"],
  plugins: [
    [
      "component",
      {
        libraryName: "element-ui",
        styleLibraryName: "theme-chalk"
      }
    ],
    ...prodPlugins
  ]
};
